﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using E_Commerce.Domain.Entities;
using E_Commerce.Application.Dto;
using E_Commerce.Domain.Dto;

namespace E_Commerce.Domain.Interfaces
{
    /// <summary>
    /// 秒杀模块
    /// </summary>
   public interface ISeckillRepository:IRepository<Seckill>
    {
        /// <summary>
        /// 显示秒杀商品
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="totalCount"></param>
        /// <returns></returns>
        List<SeckillDto> GetSeckill(int pageIndex,int pageSize,out int totalCount);
        /// <summary>
        /// 反填
        /// </summary>
        /// <param name="productId">商品表ID</param>
        /// <returns></returns>
        SeckillDto FillSeckill(int productId);
        /// <summary>
        /// 添加秒杀商品
        /// </summary>
        /// <param name="s"></param>
        /// <returns></returns>
        Task<int> AddSeckillAsync(Seckill s);
        /// <summary>
        /// 修改秒杀商品状态
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<int> UptSeckillAsync(int id);
        /// <summary>
        /// 添加到订单表
        /// </summary>
        /// <param name="orders"></param>
        /// <returns></returns>
        Task<int> AddOrderAsync(Orders orders);

    }
}
